/**
 * Created by Luo on 2018/5/25.
 */
import React from 'react';
import PropTypes from 'prop-types';

const Todo = ({onClick, completed, text}) => (
  <li
    onClick={onClick}
    style={{textDecoration: completed? 'line-through' : 'none'}}>
    {text}
  </li>
);
// 组件进行类型检查助手
Todo.propTypes = {
  onClick: PropTypes.func.isRequired,
  completed: PropTypes.bool.isRequired,
  text: PropTypes.string.isRequired
};

export default Todo;
